1. Field of the Invention
This invention relates to software tools for facilitating the generation and editing of computer programs. Specifically, this invention relates to software tools for facilitating the generation and editing of an event handler program that links an event associated with one object to an action taken by another object.
2. Description of the Related Art
In current object-oriented software environments, the objects themselves include commands for triggering outside (event-handling) programs once a pre-determined event is triggered. For example, one standard event within the Microsoft Windows environment is a xe2x80x9cmouse clickxe2x80x9d event. This type of event is triggered whenever a user depresses a mouse button while the mouse cursor is on top of the object. As the user depresses the mouse button, an event-handling program associated with the mouse click event is triggered.
Thus, particular event-handling programs can be triggered by associating them with a pre-selected event. However, writing these event-handling programs is a complicated and time-consuming task. Normally, only computer programmers have the ability to write event-handling software. For this reason, many novice computer users cannot take advantage of this powerful technology.
One of the object-oriented technologies that takes advantage of event driven applications is Microsoft""s ActiveX technology for the Internet. Users can add ActiveX components to their Hypertext Markup Language (HTML) documents so that particular events, such as a mouse click, can be used to trigger a particular event-handler. For example, an ActiveX object""s mouse click event could be linked to an event handler that connects the user to another HTML document. In this manner, the ActiveX object would act like a hyperlink to other documents on the World Wide Web.
A powerful feature of current Internet technology relates to programs or scripts which run when a user selects a particular item within an HTML document. For example, a user might fill in a form on an HTML document and then depress a xe2x80x9csubmitxe2x80x9d button to send that form to an Internet host. When the xe2x80x9csubmitxe2x80x9d button is depressed by a mouse click, a program or script is run instructing the user""s computer to gather data from the form and forward it to a pre-designated Internet site. Some scripts that are run on Internet server computers to process forms and the like are known as Common Gateway Interface (CGI) scripts. Other software for producing programs used on the Internet include the Visual Basic Language, Java Language, Visual Basic script (VBScript) language from Microsoft Corporation and the JavaScript language. More information on the VBScript language can be found in Inside Microsoft Visual Basic, Scripting Edition by Scott Hillier (Microsoft Press).
Unfortunately, implementing these scripts as ActiveX event-handling programs in an HTML document can be extremely complicated and require a thorough knowledge of programming languages and environments. The VBScript and JavaScript languages require extensive programming knowledge to implement. Thus, it can be difficult for a novice computer user to create an HTML document that includes scripts and programs that provide for a flexible world-wide web site. For this reason, a simple, convenient method is needed for producing an event handler that links an event on one object in an HTML document to an action taken by a second object within the HTML document. The present invention provides such a solution.
The present invention comprises a software program for creating and editing event handlers that are linked to objects embedded within an HTML or other Internet document. Objects are software programming components such as Microsoft Object Linking and Embedding (OLE) 2.0 objects, Corba Objects, Java Beans and OpenDoc objects. These software programming components are pre-existing modules that do not need to be modified to work within embodiments of the invention.
As used herein, the term Internet document refers to any document that can be read by Internet browsing software such as Netscape Navigator or Microsoft Internet Explorer. Types of Internet documents include HTML and Two Dimensional Markup Language (2DML) documents. An example of a 2DML document is provided in Microsoft xe2x80x9cALXxe2x80x9d files that are produced by the Microsoft ActiveX Control Pad. It should also be understood that the term xe2x80x9cInternet documentxe2x80x9d is intended to encompass any protocols or specifications that are adopted in the future to page layouts that are distributed across wide area networks.
However, for simplicity, the following description uses the terms Internet document and HTML document somewhat interchangeably. Using the program described herein, the user can generate and edit event handling scripts visually (via mouse clicks), without typing in or directly editing the underlying script code. In addition, the program displays a non-executable xe2x80x9cplain Englishxe2x80x9d narrative of the event handler scripts that have been generated.
In one embodiment, the program includes a user interface that can display graphical representations of objects, events and actions. These graphical representations are preferably displayed in separate regions or panes within a user interface window. The preferable form of the graphical representations is a hierarchical tree. The first (xe2x80x9ceventxe2x80x9d) pane includes a list of objects from the HTML document that have events which can be triggered. These objects can include ActiveX objects, scriptable HTML tags, browser window objects and any other component embedded within the Internet document.
As discussed above, an object""s event is triggered when a particular user action occurs. Thus, the software monitors regions of the user interface for interactions from the user. Examples of user actions include a mouse click, a mouse double-click and a SUBMIT button. Once the user performs an action that triggers an event, the corresponding event handling software (xe2x80x9cevent handlerxe2x80x9d) is initiated and run on the computer system. It should be noted that a user action is not necessarily required to trigger an event. For example, a timer object may include a timer event that is triggered once a pre-determined period of time has elapsed.
The second (xe2x80x9cactionxe2x80x9d) pane of the user interface includes a list of objects from the HTML document that provides actions. In this environment, an action can be a property or a method of an object on the HTML document. For example, an action might be the background color property for the chosen object.
In response to mouse clicks on the objects within the event and action panes, the program automatically generates a script that link events in the event pane to actions in the action pane. For example, a user can link a mouse click event for a first object listed in the event pane to a color property action for a second object listed in the action pane. The program then provides the desired link between the event and the action by generating a script in VBScript or JavaScript, and displaying the script in a code pane (discussed below). In the example from above, a user could cause the second object to change color following a mouse click on the first object. Therefore, when this particular HTML document is accessed through an Internet browser, any consumer that performs a mouse click on the first object will cause a color change in the second object.
The third (xe2x80x9ccodexe2x80x9d) pane of the user interface displays the event handler, which can either be an event handler interactively generated by the user via the event and action panes (in the manner described above), or a pre-existing event handler of the HTML document being edited. From the user interface, the user can select between one of two formats for viewing the event handler within this pane. In the first format, termed herein the xe2x80x9clistxe2x80x9d view, a plain English description of the link established between the first object""s event and the second object""s action is displayed. In the second format, termed herein the xe2x80x9ccodexe2x80x9d view, the user can view and build the actual Visual Basic Script(VBScript) or JavaScript code that links the first object""s event to the second object""s action.
The event handling programs are built by first filtering only those actions that are appropriate for script generation. In addition, data-type specific dialog boxes are displayed to allow the user to set properties associated with the objects. For example, if the user chooses to modify an action corresponding to a color property, the user is presented with a Windows color palette to select the proper color.
Since the event handler scripts are generated automatically in response to selection (via the mouse) of events and associated actions, it is not necessary for the user to learn the underlying programming language. In addition, since the program displays the code in an easy to understand list view, the user does not need to be concerned with programming syntax to review the links that have been established. With this system, even a novice user can add creative scripts that link objects to actions.